<template>
	<view>
		<view class="my-tips">
			温馨提示：您在物业服务中心或智慧社区APP登记了以下信息
		</view>
		<view class="my-house" v-for="room in rooms" :key="room.RId">
			<view class="my-house-info">
				<view class="my-house-area">
					{{room.CoName}}
				</view>
				<view class="my-house-name">
					{{room.RName}}
				</view>
			</view>
			<view class="my-house-label">
				<view class="my-house-label-user">
					<up-icon name="account" color="#eee" :size="28"></up-icon>{{room.HName}}(保密) | {{room.RelationName}}
				</view>
				<view class="my-house-label-family">
					我的家人(共{{room.FamilyCount}}人)
				</view>
			</view>
			<view class="my-house-main">
				已绑定
			</view>
		</view>
	</view>
</template>

<script setup>
	import mineApi from '../../../api/mine';
	import {
		onMounted,
		ref
	} from 'vue';

	const rooms = ref([])
	onMounted(async () => {
		const res = await mineApi.getMyRoomInfo();
		console.log(res);
		rooms.value = res.Data;
	})
</script>

<style lang="scss" scoped>
	.my-tips {
		padding: 10rpx 30rpx;
		background-color: #d4a8a8;
	}

	.my-house {
		position: relative;
		background-color: #0078e1;
		color: #fff;
		font-size: 32rpx;
		padding: 40rpx;
		margin: 40rpx;
		border-radius: 20rpx;

		.my-house-info {
			padding-bottom: 40rpx;
			border-bottom: 1rpx solid #fff;

			.my-house-area {
				font-size: 38rpx;
				padding-bottom: 20rpx;
			}
		}

		.my-house-label {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 20rpx 0 0;

			.my-house-label-user {
				display: flex;
				align-items: center;
			}
		}

		.my-house-main {
			font-size: 28rpx;
			color: #f5f5f5;
			background-color: #aaa;
			padding: 5rpx 20rpx;
			border-radius: 30rpx;
			position: absolute;
			top: 40rpx;
			right: 40rpx;
		}
	}
</style>